`ifndef TEST_SV
`define TEST_SV

`include "transaction.svh"

module automatic test;
	initial begin
		transaction tr1, tr2; // 定义句柄
		tr1 = new(1); // 创建第1个对象
		tr2 = new(2); // 创建第2个对象
		$display("The object address pointed to by tr1 is %0h", tr1);
		$display("The object address pointed to by tr2 is %0h", tr2);
		tr1 = tr2; // tr1和tr2指向第2个对象，第1个对象被回收
		$display("The object address pointed to by tr1 is %0h", tr1);
		tr1.print();
		tr2 = null; // 只有tr1指向第2个对象
	end
endmodule

`endif
